package com.ziyun.pop.modules.order.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ziyun.pop.modules.order.entity.OrderItemEntity;
import com.ziyun.pop.modules.order.vo.FactoryOrderItemVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 订单详情表
 *
 * @author gaosheng
 * @email
 * @date 2018-09-27
 */
@Service("ErpOrderItemDao")
public interface OrderItemDao extends BaseMapper<OrderItemEntity> {

    /**
     * 查询订单商品列表
     * @param orderId
     * @return
     */
    List<OrderItemEntity> selectByOrderId(Long orderId);

    /**
     * 查询工厂订单商品列表
     * @param orderId
     * @return
     */
    List<FactoryOrderItemVo> selectFactoryOrderItemByOrderId(@Param("orderId") Long orderId);

    /**
     * 数据更新
     * @param map
     * @param itemId
     * @return
     */
    int updateByMap(@Param("map") Map<String, Object> map, @Param("itemId") Integer itemId);
}
